package com.headingdata.variable;

public class VariableDemo {
    public static void main(String[] args) {

        //1. byte short int long
        byte a = 127; //-128~127
        //byte a1 = 128; // 越界了

        short s = 12345;
        //short s1 = 94561; // 越界了

        int i = 451335664;

        //注意：随便写一个整型字面量默认是int类型，如果希望写一个整型是long类型，需要加L/l
        long lg = 4562457114542L;

        //2.float double
        //注意：随便写小说字面量，默认是double,如果希望小数是float,后面加F/f
        float f = 3.14F;

        double d = 4.456;

        //3.char 字符型
        char ch = 'a';
        char ch1 = '中';

        //4.boolean
        boolean flag = true;
        boolean flag2 = false;

        //5.引用类型 String
        String name = "张三";
        System.out.println(name);
    }
}
